package ch4;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
import java.io.PrintWriter;

@WebFilter(filterName = "MyFilter",value = "/my")
public class MyFilter implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        PrintWriter  out=resp.getWriter();
        out.write("Hello Myfilter");
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
